﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Core.Services
{
	using Falcon.Core.Collections;
	using Falcon.Core.Domain;
	using Falcon.Core.Domain.Repositories;
	using Falcon.Core.Domain.Services;

	public class UserGroupPhotoService : IUserGroupPhotoService
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="UserGroupPhotoService"/> class.
		/// </summary>
		/// <param name="userGroupPhotoRepository">The user group photo repository.</param>
		public UserGroupPhotoService(IUserGroupPhotoRepository userGroupPhotoRepository)
		{
			this.UserGroupPhotoRepository = userGroupPhotoRepository;
		}

		/// <summary>
		/// Gets or sets the user group photo repository.
		/// </summary>
		/// <value>The user group photo repository.</value>
		public IUserGroupPhotoRepository UserGroupPhotoRepository
		{
			get; 
			private set;
		}

		/// <summary>
		/// Gets the user group photo by id.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		public UserGroupPhoto GetById(int id)
		{
			return this.UserGroupPhotoRepository.GetById(id);
		}

		/// <summary>
		/// Gets all the users group photos.
		/// </summary>
		/// <param name="specification">The <see cref="UserGroupPhotoSpecification"/>.</param>
		/// <returns></returns>
		public IPagedList<UserGroupPhoto, UserGroupPhotoSpecification> GetPaged(UserGroupPhotoSpecification specification)
		{
			return this.UserGroupPhotoRepository.GetPaged(specification);
		}

		/// <summary>
		/// Creates the user group photo.
		/// </summary>
		/// <returns></returns>
		public UserGroupPhoto Create()
		{
			return new UserGroupPhoto();
		}

		/// <summary>
		/// Inserts the user group photo into the storage.
		/// </summary>
		/// <param name="photo">The photo.</param>
		public void Insert(UserGroupPhoto photo)
		{
			this.UserGroupPhotoRepository.Insert(photo);
		}

		/// <summary>
		/// Deletes the user group photo in the storage.
		/// </summary>
		/// <param name="photo">The photo.</param>
		public void Delete(UserGroupPhoto photo)
		{
			this.UserGroupPhotoRepository.Delete(photo);
		}
	}
}